{% extends "base.html" %}

{% block content %}
<div class="container-fluid">
    <div class="card">
        <div class="card-header d-flex justify-content-between align-items-center">
            <h5 class="mb-0">
                <i class="fas fa-bell me-2"></i>通知设置
            </h5>
            <a href="{{ url_for('settings.settings_index') }}" class="btn btn-secondary">
                <i class="fas fa-arrow-left me-1"></i>返回
            </a>
        </div>
        <div class="card-body">
            <form method="post">
                <div class="mb-4">
                    <h6 class="mb-3">设备警报通知</h6>
                    <div class="form-check mb-2">
                        <input class="form-check-input" type="checkbox" id="device_offline" name="device_offline" value="1"
                            {{ 'checked' if settings and settings.device_offline }}>
                        <label class="form-check-label" for="device_offline">
                            设备离线通知
                        </label>
                    </div>
                    <div class="form-check mb-2">
                        <input class="form-check-input" type="checkbox" id="device_error" name="device_error" value="1"
                            {{ 'checked' if settings and settings.device_error }}>
                        <label class="form-check-label" for="device_error">
                            设备故障通知
                        </label>
                    </div>
                </div>

                <div class="mb-4">
                    <h6 class="mb-3">水质警报通知</h6>
                    <div class="form-check mb-2">
                        <input class="form-check-input" type="checkbox" id="water_quality" name="water_quality" value="1"
                            {{ 'checked' if settings and settings.water_quality }}>
                        <label class="form-check-label" for="water_quality">
                            水质异常通知
                        </label>
                    </div>
                    <div class="form-check mb-2">
                        <input class="form-check-input" type="checkbox" id="water_pressure" name="water_pressure" value="1"
                            {{ 'checked' if settings and settings.water_pressure }}>
                        <label class="form-check-label" for="water_pressure">
                            水压异常通知
                        </label>
                    </div>
                </div>

                <div class="mb-4">
                    <h6 class="mb-3">维护提醒</h6>
                    <div class="form-check mb-2">
                        <input class="form-check-input" type="checkbox" id="maintenance_reminder" name="maintenance_reminder" value="1"
                            {{ 'checked' if settings and settings.maintenance_reminder }}>
                        <label class="form-check-label" for="maintenance_reminder">
                            定期维护提醒
                        </label>
                    </div>
                    <div class="form-check mb-2">
                        <input class="form-check-input" type="checkbox" id="inspection_reminder" name="inspection_reminder" value="1"
                            {{ 'checked' if settings and settings.inspection_reminder }}>
                        <label class="form-check-label" for="inspection_reminder">
                            定期检查提醒
                        </label>
                    </div>
                </div>

                <button type="submit" class="btn btn-primary">
                    <i class="fas fa-save me-1"></i>保存设置
                </button>
            </form>
        </div>
    </div>
</div>
{% endblock %} 